
public class e004 {
    public static void main(String[] args) {
        long sTime = System.currentTimeMillis();
        loop:
        for (int i = 999; i > 900; i--) {
            for (int j = i; j > 900; j--) {
                int n = i * j;
                if(isPali(n)){
                    System.out.println(i * j);
                    long fTime = System.currentTimeMillis();
                    System.out.println("Time: " + (fTime - sTime) + "ms");
                    break loop;
                }
            }
        }
    }

    public static boolean isPali(int i) {
        String l = String.valueOf(i);
        StringBuilder b = new StringBuilder(l).reverse();
        if (String.valueOf(b).equals(l)){
            return true;
        }
        return false;
    }
}